package to

import (
	"TODecider/src/comnet"
	"math"
)

// return -1 -> can't execute, 0 -> blank execution, 1 -> ready execution
func predExecutable(w [4]float64, node comnet.Node) float64 {
	// kernels (K)
	x := node.RestComputing[0]
	// frequency (GHz)
	y := node.RestComputing[1]
	// utilization (%)
	u := node.RestComputing[2]
	return 1e3 * (w[0]*math.Exp(-w[1]*(x*(1-u)+w[2]*y)) + w[3])

}
